﻿using System;

using SBPweb.PROvibe.Server.Framework.Session;
using SBPweb.PROvibe.Server.Framework.Communication;

namespace SBPweb.PROvibe.Server.Host
{

    public class Global : System.Web.HttpApplication
    {
        
        private PolicySocketServer pss;

        protected void Application_Start(object sender, EventArgs e)
        {
            pss = new PolicySocketServer();
            pss.StartAsync();
        }

        protected void Session_Start(object sender, EventArgs e)
        {
            SessionManager.PublicateSession();
        }

        protected void Application_BeginRequest(object sender, EventArgs e)
        {

        }

        protected void Application_AuthenticateRequest(object sender, EventArgs e)
        {

        }

        protected void Application_Error(object sender, EventArgs e)
        {

        }

        protected void Session_End(object sender, EventArgs e)
        {
            SessionManager.RevokeSession();
        }

        protected void Application_End(object sender, EventArgs e)
        {
            SessionManager.GCAppStateValues();
        }

    }

}